<?php

header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:POST,GET,PUT,DELETE');
header('Access-Control-Allow-Headers:x-requested-with,Content-Type,X-CSRF-Token');



header("content-type:text/html;charset=utf-8");
$type_id = $_GET["type_id"];
$mysqli = new mysqli("localhost", "root", "root", "db_jiuji");
mysqli_query($mysqli, "set names 'utf8'");
if ($mysqli->connect_errno) {
    die();
}
$sql = "select *from j_goods where type_id=${type_id}";
$result = $mysqli->query($sql);
//   $row = $result->fetch_assoc()
while ($row = $result->fetch_assoc()) {
    $data[] = $row;
}
print_r(json_encode($data));
